﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Xml.Linq;
using Microsoft.Xna.Framework.Input;

namespace chemicall
{
    public class OptionMenu : MenuScreen
    {
        public bool soundOn = true;

        public OptionMenu()
            : base("Option")
        {
            MenuItem soundMenuEntry;
            if (soundOn)
                soundMenuEntry = new MenuItem("Desactiver le son");
            else
                soundMenuEntry = new MenuItem("Activer le son");
            MenuItem backMenuEntry = new MenuItem("Retour");

            soundMenuEntry.Selected += SoundMenuEntryMenuEntrySelected;
            backMenuEntry.Selected += PlayMainMenuEntrySelected;

            MenuEntries.Add(soundMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }

        void SoundMenuEntryMenuEntrySelected(object sender, System.EventArgs e)
        {
            //TODO activer le FMOD ou non
            this.ScreenManager.LastScreen = this;
            soundOn = !soundOn;
        }

        void PlayMainMenuEntrySelected(object sender, System.EventArgs e)
        {
            ScreenManager.AddScreen(this.ScreenManager.LastScreen, PlayerIndex.One);
            this.ScreenManager.LastScreen = this;
        }
    }
}
